using System;
using System.Collections.Generic;
using System.Text;

   using NUnit.Framework;
   using TestClass = NUnit.Framework.TestFixtureAttribute;
   using TestMethod = NUnit.Framework.TestAttribute;
   using TestInitialize = NUnit.Framework.SetUpAttribute;
   using TestCleanup = NUnit.Framework.TearDownAttribute;
   using ClassInitialize = NUnit.Framework.TestFixtureSetUpAttribute;
   using ClassCleanup = NUnit.Framework.TestFixtureTearDownAttribute;
using Blazing.BusinessObjects.Locations;

namespace BusinessObjectTests.Reservations
{
    [TestClass]
    public class AddressTypeTests : NHibernateInMemoryTestFixtureBase
    {
        private void CheckValues(AddressType obj, AddressType newObj)
        {
            Assert.AreEqual(obj.ID, newObj.ID);
            Assert.AreEqual(obj.Name, newObj.Name);
            Assert.AreEqual(obj.RowStamp, newObj.RowStamp);
        }

        [TestMethod]
        public void CreateAddressType()
        {
            AddressType obj = BusinessObjectFactory.CreateAndFillAddressType();
            obj.Save();

            AddressType obj2 = AddressType.Load(obj.ID);
            Assert.IsNotNull(obj2);

            CheckValues(obj, obj2);

            obj.Delete();
            obj.Save();
        }
    }
}
